(function($) {
$(document).ready(function() {

	/*var validator = $('#email_form').validate({
		rules: {
			email_user: {
				required: true,
				check_email_login: true
			},
			email_password: {
				required: true,
				minlength: 5
			}
		},
		messages: {
			email_user: {
				required: "Введите название"
			},
			email_password: {
				required: "Введите пароль",
				minlength: jQuery.format("Не менее {0} символов")
			}
		},

		errorPlacement: function(error, element) {
			if ( element.is(":radio") )
				error.appendTo( element.parent().next().next() );
			else if ( element.is(":checkbox") )
				error.appendTo ( element.next() );
			else
				error.appendTo( element.parent().next() );
		},

		submitHandler: function() {

		},
                
		success: function(label) {
			// set &nbsp; as text for IE
			label.html("&nbsp;").addClass("checked");
		}
		
		//onkeyup: false
	});*/
	
	$.validator.addMethod("check_email_login", function(value, element) 
	{
		value = value + '@test.com';
		if ((/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,4}$/i).test(value))
			return true;
		else
		{
			$.validator.messages.check_email_login = "Некорректные символы";
			return false;
		}
	});
});

})(jQuery);
